<template>
	<view class="">
		<view class="">
			<starSwiper :datas="detail" :config="config" @change="swiperChange" @tapFun="tapFun"></starSwiper>

		</view>

		<!-- 广告图 -->
		<view style="width: 100%;height: 10vh;margin-top: 14px;" class="">
			<img style="width: 100%;height: 100%;border-radius: 15px;"
				src="https://img1.baidu.com/it/u=1176362935,1432244848&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1706547600&t=cc073152959dc4074d0ebeb151da4c2e"
				alt="">
		</view>

		<view v-for="(topicSku,indexa) in starSkuList" :key="indexa" class="" style="margin-top: 10px;">
			<marketItem :topicSku="topicSku"></marketItem>
		</view>
	</view>
</template>

<script>
	import starSwiper from '../components/starSwiper.vue'
	import marketItem from '../components/marketItem.vue'
	export default {
		data() {
			return {
				starSkuList: [],
				current: 0,
				pages: 1,
				detail: {
					title: "热门中转站",
					subLable: "根据上周种猪那盏热力值推荐~",
					list: [{
							id: 1,
							name: '范丞丞',
							img: "https://img1.baidu.com/it/u=525857817,4009704940&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750",
							fensi: "1241粉丝"
						},
						{
							id: 2,
							name: '蔡徐坤',
							img: "https://img2.baidu.com/it/u=3881313606,2790146805&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
							fensi: "粉丝飙升中"
						},
						{
							id: 3,
							name: '王二博',
							img: "https://img2.baidu.com/it/u=3780033392,4206444395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=666",
							fensi: "1412爆米花"
						}
					],
				},
				config: {
					more: "true",
					hideMargin: "true",
					circular: "true"
				}
			}
		},
		mounted() {

			this.getStarSkuList()
		},
		components: {
			starSwiper,
			marketItem
		},
		methods: {
			async getStarSkuList() {
				if (this.current < this.pages) {
					this.current++
					console.log(this.current);
					let form = {
						current: this.current,
						size: 3,
						source: 2
					}

					let result = await this.$u.api.getTopicSku(form);


					this.pages = result.pages

					this.starSkuList = this.starSkuList.concat(result.records);
				


				} else {
					console.log("没有数据了");
				}


			}

		}
	}
</script>

<style>
</style>